<template>
  <router-view />
</template>

<script setup>
import useSettingsStore from '@/store/modules/settings'
import { handleThemeStyle } from '@/utils/theme'
onMounted(() => {
  nextTick(() => {
    // 初始化主题样式
    handleThemeStyle(useSettingsStore().theme)
    if (useSettingsStore().isEyeProtection) {
      // 给html添加class类为eyeProtection
      document.documentElement.classList.add('eyeProtection')
    } else {
      // 给html删除class类为eyeProtection
      document.documentElement.classList.remove('eyeProtection')
    }
  })
})

// watch(version, (newVal, oldVal) => {
//   if (newVal !== oldVal) {
//     console.log('发现新内容，自动更新中...')
//   }
// })
</script>
